<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="div1"></div>
  <script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
  <script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
  <script src="http://static.runoob.com/assets/react/browser.min.js"></script>
  <script type="text/babel">
    // 条件渲染：用过if判断来显示不同的内容。需要放在自执行函数中
    let isShow = true;
    let node1 = (<div>
        {(function() {
          if(isShow) {
            return <p>111</p>
          }else {
            return <p>000</p>
          }
        })()}
      </div>)
    ReactDOM.render(node1, div1);
  </script>
  <script>
    // 匿名函数自执行
    (function () {
      console.log(444);
    })()
  </script>
</body>
</html>